package com.sujeet.office.tracker.entity;

import java.util.Date;

public class Task {

	private int id = 0;
	private String summary = "none";
	private String assignee = "testAssignee";
	private int remainingEffort = 365;
	private Date startDate = new Date(); // default ctor creates with current date.
	private Date endDate = new Date(); 
	private ActivityStatus status = ActivityStatus.NOT_STARTED;
	private String remarks = "none";

	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getAssignee() {
		return assignee;
	}
	public void setAssignee(String assignee) {
		this.assignee = assignee;
	}
	public int getRemainingEffort() {
		return remainingEffort;
	}
	public void setRemainingEffort(int remainingEffort) {
		this.remainingEffort = remainingEffort;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public ActivityStatus getStatus() {
		return status;
	}
	public void setStatus(ActivityStatus status) {
		this.status = status;
	}
	public String getRemarks() {
		return remarks;
	}
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	public String toString() {
		return ("Id: " + id + " summary: " + summary + " remainingEffort:" + remainingEffort +
				" startDate: " + startDate + " endDate:" + endDate + " status: " + status + 
				" remarks: " + remarks);
	}
	
	public boolean equals(Object that) {
		if (that == this) return true;
		if (that instanceof Task) {
			Task thatObj = (Task) that;
			if (thatObj.id == this.id) return true;
		}
		return false;
	}
}
